Skip to main content

Test Quarantining

Once you've detected flaky tests, the next step is to fix them. That takes time, and in the meantime they keep failing builds.

Quarantine is a label in BuildPulse that marks a test as known flaky. It does not change your CI result on its own. To keep quarantined tests from failing builds, your pipeline reads the quarantine list from the BuildPulse API and acts on it:

  1. Tests are quarantined automatically when they cross a threshold, or by hand.
  2. Your pipeline queries the API for quarantined tests.
  3. Your pipeline ignores failures of those tests, or skips them.
  4. When the test is fixed, it is released from quarantine.

The full rules, with a complete GitHub Actions example and gate script, are in How flaky tests are detected and quarantined.

Configure Thresholds​

  1. Open your repository in BuildPulse.
  2. Go to the Flaky Tests tab, then Settings ("Flaky Test Settings").
  3. Set the values for the repository. A saved change applies to uploads processed after you save. Nothing already flagged or quarantined is re-evaluated.
SettingDefaultWhat it does
Flaky Detection Threshold3%The 30-day failure rate at or above which failure-rate detection flags a test.
Auto-Quarantine Threshold10%The 30-day failure rate at or above which a flagged test is quarantined. 0 turns automatic quarantine off.
Minimum Test Runs10Runs in the 30-day window a test needs before failure-rate detection evaluates it.
Minimum Branch Count2Distinct branches with at least one failure in the 30-day window that failure-rate detection requires.

Two numbers are fixed: the 30-day window, and a floor of 30 runs in that window before a test is quarantined automatically (or Minimum Test Runs, if you set that higher).

Only failure-rate detection quarantines automatically. A test that passes and fails on the same code is flagged as flaky but is not quarantined automatically, however often it flakes. You can quarantine any test by hand from its page or from the Flaky Tests list.

Query the Quarantine API​

  1. Create an API key under Organization Settings, then API Keys. The same key works for uploads.
  2. Query the API for quarantined tests:

URL: GET https://platform.buildpulse.io/api/v1/flaky/tests

Authorization: Authorization: Bearer ${BUILDPULSE_API_TOKEN}

Query Parameters:

  • repository (required, or repository_id): The name of your repository.
  • repository_id (required, or repository): The ID of your repository.
  • quarantine: Quarantined tests are returned by default. Set to false to return flaky tests that are not quarantined.
  • include: Comma-separated list of extra attributes. Supported values: disruptiveness_ratio, nondeterministic_negative_result_count, nondeterminism_first_recorded_at, recent_nondeterministic_commit_oid, recent_nondeterministic_negative_result, recent_nondeterministic_positive_result, tags, quarantine_date, quarantined_by, quarantine_type, time_consumed, pass_rate, avg_duration_ms. Example: include=quarantine_date,disruptiveness_ratio
  • limit: Page size. Default 25, maximum 100.
  • after: Pagination cursor, taken from metadata.after of the previous page. The value is null on the last page.

Reading the API needs a plan with API access: Team, Growth, Enterprise, a trial, or a paid runner subscription. Other plans receive a 403 response. The full reference is at platform.buildpulse.io/docs.

  1. Sample Response:
{
"count": 1,
"tests": [
{
"id": "<test id>",
"name": "System Posts Lifecycle Basic posts flow can edit a post",
"suite": "rspec",
"class": "spec.system.posts_lifecycle_spec",
"file": "./spec/system/posts_lifecycle_spec.rb"
}
],
"metadata": {
"after": null,
"limit": 25
}
}

Disable/Skip Tests​

There are two ways to use the list:

  • Gate on the failures that matter. Run tests as usual, upload the results, then fail the job only if a test that is not quarantined failed. Quarantined tests keep producing results, so you can see in BuildPulse whether they have become stable. Match on suite and name.
  • Skip before running. Turn the list into your test runner's exclude option. Skipped tests produce no results, so BuildPulse can no longer tell you whether they still fail. Consult the documentation of your test framework for excluding individual tests.

Critical Tests​

A test marked as critical is never quarantined automatically. You can still quarantine it by hand, and tests that are already quarantined stay quarantined.

To mark a test as critical, open it from the Tests tab and tick Critical Priority.

Track & Re-enable tests (Jira/GitHub Issues)​

Quarantine does not expire, and a test passing does not release it. A test leaves quarantine in one of these ways:

  • Resolve on the flaky test's page, or Bulk Resolve Quarantined Tests on the repository's Settings tab, which resolves every quarantined test in the repository.
  • The Jira ticket that BuildPulse filed for it moves to Done.
  • Its linked GitHub issue is closed.

BuildPulse can file the Jira ticket automatically when a test is quarantined. See Project Management Integration.

If a released test still meets the automatic quarantine conditions, the next upload that includes it quarantines it again. To stop that, fix the test, raise the threshold, or mark the test as critical.